﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace NeverFeel
{
	public partial class AddServerForm : NeverFeel.BaseForm
	{
		public AddServerForm()
		{
			InitializeComponent();
		}

		public static bool GetNewServer(ref string name, ref string host, ref int port)
		{
			using (AddServerForm frm = new AddServerForm())
			{
				frm.NameBox.Text = name;
				frm.IPBox.Text = host.Length > 0 ? host : "255.255.255.255";
				frm.PortBox.Value = port > 0 ? port : 80;

				if (frm.ShowDialog() == DialogResult.OK)
				{
					name = frm.NameBox.Text;
					host = frm.IPBox.Text;
					port = Convert.ToInt32(frm.PortBox.Value);
					return true;
				}

				return false;
			}
		}

		private void OKBtn_Click(object sender, EventArgs e)
		{

		}
	}
}
